home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 2_12.lha / 2_12 / 2_12.c next >
Text File  |  1993-08-08  |  540b  |  21 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. / print the size of a string array
  6. include <stream.h>
  7. include <string.h>
  8.  
  9. har Str[] = "a short string";
  10.  
  11. nt main(int, char**)
  12.  
  13.    cout << "sizeof(Str)=" << sizeof(Str) << "\n";
  14.    cout << "strlen(Str)=" << strlen(Str) << "\n";
  15.    cout << "sizeof(\"a short string\")=" <<
  16. sizeof("a short string") << "\n";
  17.    cout << "strlen(\"a short string\")=" <<
  18. strlen("a short string") << "\n";
  19.    return 0;
  20.  
  21.